package it.basilikos.core.model;

import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.PersistenceContext;
import javax.persistence.Table;

import org.hibernate.validator.constraints.NotEmpty;

@Entity
@PersistenceContext
@Table(name="agent")
public class Agent extends BaseEntity{
	
	private static final long serialVersionUID = -7963481358569018530L;
	
	@Column(name = "username")
	@NotEmpty
	private String username;
	
	@Column(name = "password")
	@NotEmpty
	private String password;
	
	@Column(name = "name")
	@NotEmpty
	private String name;
	
	@Column(name = "surname")
	@NotEmpty
	private String surname;
	
//	@OneToMany(fetch = FetchType.LAZY,cascade={CascadeType.ALL})
//	@JoinColumn(name="id")
	@OneToMany(mappedBy="agent")
	private List<Sell> sells;
	
	public Agent(){}
	
	public Agent(String username, String password, String name, String surname) {
		super();	
		this.username = username;
		this.password = password;
		this.name = name;
		this.surname = surname;
	}
	
	public Agent(Long id,String username, String password, String name, String surname) {
		super();
		this.id = id;		
		this.username = username;
		this.password = password;
		this.name = name;
		this.surname = surname;
	}
	
	 

	public String getUsername() {
		return username;
	}

	
	public String getPassword() {
		return password;
	}

	
	public String getName() {
		return name;
	}

	public String getSurname() {
		return surname;
	}
 
	public void setUsername(String username) {
		this.username = username;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	public List<Sell> getSells() {
		return sells;
	}
	
	public void setSells(List<Sell> sells) {
		this.sells = sells;
	}
	
	
	
	
	
	
}
